package javaclass.innerClass;

public class ServiceA {
    static {System.out.println("This is static of ServiceA...");}
    private ServiceA() {System.out.println("ServiceA single instance created.");}
    private ServiceA(String s) {}
    private static class SingleHold {
        static {System.out.println("This is static of inner class of ServiceA...");}
        private static ServiceA sa = new ServiceA();
    }
    public static ServiceA getServiceASingleInstance() {
        return SingleHold.sa;
    }
    public void say() {
        System.out.println("ServiceA.say");
    }
    public static void staticM() {
        System.out.println("This is ServiceA.staticM...");
    }
    public static ServiceA staticCreateInstance() {
        ServiceA serviceA = new ServiceA("s");
        System.out.println("create ServiceA instance end");
        return serviceA;
    }
}
